<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>llfifo: xllfifo_interrupt_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">llfifo
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xllfifo__interrupt__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xllfifo_interrupt_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file demonstrates how to use the Streaming fifo driver on the xilinx AXI Streaming FIFO IP.The AXI4-Stream FIFO core allows memory mapped access to a AXI-Stream interface. </p>
<p>The core can be used to interface to AXI Streaming IPs similar to the LogiCORE IP AXI Ethernet core, without having to use full DMA solution.</p>
<p>This is the interrupt example for the FIFO it assumes that at the h/w level FIFO is connected in loopback.In these we write known amount of data to the FIFO and wait for interrupts and after completely receiving the data compares it with the data transmitted.</p>
<p>Note: The TDEST Must be enabled in the H/W design inorder to get correct RDR value.</p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
----- ---- -------- -------------------------------------------------------
3.00a adk 08/10/2013 initial release CR:727787
5.1   ms  01/23/17   Modified xil_printf statement in main function to
                     ensure that "Successfully ran" and "Failed" strings
                     are available in all examples. This is a fix for
                     CR-965028.
      ms  04/05/17   Added tabspace for return statements in functions for
                     proper documentation and Modified Comment lines
                     to consider it as a documentation block while
                     generating doxygen.
5.3  rsp 11/08/18    Modified TxSend to fill SourceBuffer with non-zero
                     data otherwise the test can return a false positive
                     because DestinationBuffer is initialized with zeros.
                     In fact, fixing this exposed a bug in FifoRecvHandler
                     and caused the test to start failing. According to the
                     product guide (pg080) for the AXI4-Stream FIFO, the
                     RDFO should be read before reading RLR. Reading RLR
                     first will result in the RDFO being reset to zero and
                     no data being received.
5.6   sd  07/7/23    Add system devicetree support.
</pre><hr/>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a8d6febbfb5e669f63287fc75c282d1f6"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xllfifo__interrupt__example_8c.html#a8d6febbfb5e669f63287fc75c282d1f6">XLlFifoInterruptExample</a> (<a class="el" href="struct_x_ll_fifo.html">XLlFifo</a> *InstancePtr, u16 DeviceId)</td></tr>
<tr class="memdesc:a8d6febbfb5e669f63287fc75c282d1f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function demonstrates the usage of AXI FIFO It does the following:  <a href="#a8d6febbfb5e669f63287fc75c282d1f6">More...</a><br/></td></tr>
<tr class="separator:a8d6febbfb5e669f63287fc75c282d1f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aedb200dfa9fb520a0a99c70134fa54b7"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xllfifo__interrupt__example_8c.html#aedb200dfa9fb520a0a99c70134fa54b7">SetupInterruptSystem</a> (INTC *IntcInstancePtr, <a class="el" href="struct_x_ll_fifo.html">XLlFifo</a> *InstancePtr, u16 FifoIntrId)</td></tr>
<tr class="memdesc:aedb200dfa9fb520a0a99c70134fa54b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function setups the interrupt system such that interrupts can occur for the FIFO device.  <a href="#aedb200dfa9fb520a0a99c70134fa54b7">More...</a><br/></td></tr>
<tr class="separator:aedb200dfa9fb520a0a99c70134fa54b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a38cd37c9e86c6d514d731db7bc520a0b"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xllfifo__interrupt__example_8c.html#a38cd37c9e86c6d514d731db7bc520a0b">TxSend</a> (<a class="el" href="struct_x_ll_fifo.html">XLlFifo</a> *InstancePtr, u32 *SourceAddr)</td></tr>
<tr class="memdesc:a38cd37c9e86c6d514d731db7bc520a0b"><td class="mdescLeft">&#160;</td><td class="mdescRight">TxSend routine, It will send the requested amount of data at the specified addr.  <a href="#a38cd37c9e86c6d514d731db7bc520a0b">More...</a><br/></td></tr>
<tr class="separator:a38cd37c9e86c6d514d731db7bc520a0b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xllfifo__interrupt__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function.  <a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br/></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function. </p>
<p>This function is the main entry of the AXI FIFO interrupt test.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if tests pass<ul>
<li>XST_FAILURE if fails.</li>
</ul>
</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="xllfifo__interrupt__example_8c.html#a8d6febbfb5e669f63287fc75c282d1f6">XLlFifoInterruptExample()</a>.</p>

</div>
</div>
<a class="anchor" id="aedb200dfa9fb520a0a99c70134fa54b7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SetupInterruptSystem </td>
          <td>(</td>
          <td class="paramtype">INTC *&#160;</td>
          <td class="paramname"><em>IntcInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_ll_fifo.html">XLlFifo</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>FifoIntrId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function setups the interrupt system such that interrupts can occur for the FIFO device. </p>
<p>This function is application specific since the actual system may or may not have an interrupt controller. The FIFO could be directly connected to a processor without an interrupt controller. The user should modify this function to fit the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>contains a pointer to the instance of the FIFO component which is going to be connected to the interrupt controller.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if successful, otherwise XST_FAILURE.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xllfifo__interrupt__example_8c.html#a8d6febbfb5e669f63287fc75c282d1f6">XLlFifoInterruptExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a38cd37c9e86c6d514d731db7bc520a0b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int TxSend </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_ll_fifo.html">XLlFifo</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>SourceAddr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>TxSend routine, It will send the requested amount of data at the specified addr. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the instance of the <a class="el" href="struct_x_ll_fifo.html" title="This typedef defines a run-time instance of an XLlFifo device. ">XLlFifo</a> component.</td></tr>
    <tr><td class="paramname">SourceAddr</td><td>is the address of the memory</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the instance of the <a class="el" href="struct_x_ll_fifo.html" title="This typedef defines a run-time instance of an XLlFifo device. ">XLlFifo</a> component.</td></tr>
    <tr><td class="paramname">SourceAddr</td><td>is the address where the FIFO stars writing</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None </dd></dl>

<p>References <a class="el" href="group__llfifo.html#gaa49ecc1529434fd932d8a65d63a1a04d">XLlFifo_iTxSetLen()</a>, <a class="el" href="group__llfifo.html#gac02405b23499d780e7bc1dfe371281a6">XLlFifo_iTxVacancy()</a>, and <a class="el" href="group__llfifo.html#ga29654d755dce84b861022179c99ca7a3">XLlFifo_TxPutWord()</a>.</p>

<p>Referenced by <a class="el" href="xllfifo__interrupt__example_8c.html#a8d6febbfb5e669f63287fc75c282d1f6">XLlFifoInterruptExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a8d6febbfb5e669f63287fc75c282d1f6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XLlFifoInterruptExample </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_ll_fifo.html">XLlFifo</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>DeviceId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function demonstrates the usage of AXI FIFO It does the following: </p>
<pre class="fragment">  - Set up the output terminal if UART16550 is in the hardware build
  - Initialize the Axi FIFO Device.
  - Set up the interrupt handler for fifo
  - Transmit the data
  - Compare the data
  - Return the result
</pre><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the instance of the <a class="el" href="struct_x_ll_fifo.html" title="This typedef defines a run-time instance of an XLlFifo device. ">XLlFifo</a> instance. </td></tr>
    <tr><td class="paramname">DeviceId</td><td>is Device ID of the Axi Fifo Device instance, typically XPAR_&lt;AXI_FIFO_instance&gt;_DEVICE_ID value from xparameters.h.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>-XST_SUCCESS to indicate success -XST_FAILURE to indicate failure </dd></dl>

<p>References <a class="el" href="struct_x_ll_fifo.html#a458030a162537427b617cbb204a701fd">XLlFifo::BaseAddress</a>, <a class="el" href="xllfifo__interrupt__example_8c.html#aedb200dfa9fb520a0a99c70134fa54b7">SetupInterruptSystem()</a>, <a class="el" href="xllfifo__interrupt__example_8c.html#a38cd37c9e86c6d514d731db7bc520a0b">TxSend()</a>, <a class="el" href="group__llfifo.html#gae3bfcad24428233d9e2a8a861e2d9eed">XLLF_INT_ALL_MASK</a>, <a class="el" href="group__llfifo.html#ga549da0fb83b3bb11ea6401b8001f9c4e">XLlFfio_LookupConfig()</a>, <a class="el" href="group__llfifo.html#ga874c22807476dc0ffec670c38f452443">XLlFifo_CfgInitialize()</a>, <a class="el" href="group__llfifo.html#gac712eea89e9d7fa37d095003c927c61e">XLlFifo_IntClear</a>, <a class="el" href="group__llfifo.html#gae65ece5c6c9cce1ccdcf9d404fd8f463">XLlFifo_IntEnable</a>, and <a class="el" href="group__llfifo.html#ga095f3e0f8571dc02959852e38237f23e">XLlFifo_Status</a>.</p>

<p>Referenced by <a class="el" href="xllfifo__interrupt__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
